<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>选择老师</title>
    <link rel="stylesheet" type="text/css" href="css/aui.css">
    <link rel="stylesheet" href="css/style.css" />
	<link rel="stylesheet" href="css/my.css">
    <style>
        .aui-bar-btn-item {
            border: none;
        }
        .aui-user-img {
		    width: 80px;
		    height: 60px;
		    margin-right: 1rem;
		}

    </style>
</head>

<body class="aui-background-white">
    <!--header-->
    <header class="aui-bar aui-bar-nav aui-bar-nav-search aui-text-default aui-background-white">
        <a class="aui-pull-left aui-btn " href="JavaScript:history.go(-1)">
	        <span class="aui-iconfont aui-icon-left aui-text-gray"></span>
	    </a>
        <div class="aui-title">
           	 选择老师
        </div>
    </header>

    <!--购物车已有商品列表-->
    <section class="aui-content aui-nav-search-fixed aui-background-white">
        <div class="" style="margin-top: 2.25rem;" id="teacher">
        	<div class="divHeight"></div>
			<div class="aui-flex aui-margin-b-10  aui-padded-t-10 aui-padded-b-5 aui-border-b">
				<label><input class="aui-radio" type="radio" name="radio2" checked></label>
				
					<div class="aui-user-img" style="margin-left: .5rem;">
						<img src="images/user.png" alt="">
					</div>
					<a href="teacherDetail.html" class="aui-width-one">
						<div class="aui-flex-box aui-text-gray aui-text-left aui-arrow">
							<h2 class="aui-text-gray aui-font-size-14 aui-margin-b-5">李老师</h2>
							<p class="aui-text-gray aui-font-size-12">3年教龄</p>
						</div>
					</a>						
			</div>
			<div class="aui-flex  aui-margin-b-15  aui-padded-t-5 aui-padded-b-5 aui-border-b">
				<label><input class="aui-radio" type="radio" name="radio2" checked></label>
				<div class="aui-user-img" style="margin-left: .5rem;">
					<img src="images/user.png" alt="">
				</div>
				<a href="teacherDetail.html" class="aui-width-one">
						<div class="aui-flex-box aui-text-gray aui-text-left aui-arrow">
							<h2 class="aui-text-gray aui-font-size-14 aui-margin-b-5">李老师</h2>
							<p class="aui-text-gray aui-font-size-12">3年教龄</p>
						</div>
					</a>						
			</div>
			
		</div>
    </section>


    <script src="js/jquery-1.7.2.min.js"></script>
	
    <script>
	$('body').on('click','input[type=radio]',function(){
		console.log(1)

    })
	var baseurl = 'http://kt.zhangzhengjiang.top/api/';
	var static_url = 'http://kt.zhangzhengjiang.top/';
	mrTeacherAll();
	function mrTeacherAll(){
		$.ajax({
			url:baseurl+'index/getMrTeacherAll',
			type:'post',
			success:function(res){
				if(res.code == 1){
					var data = res.data;
					var html = '';
					console.log(data);

					for (var i = 0; i < data.length; i++) {
						html+='<div class="aui-flex aui-margin-b-10  aui-padded-t-10 aui-padded-b-5 aui-border-b">';
							html+='<label><input class="aui-radio" type="radio" name="" onclick="getTeacherId('+data[i].id+')"></label>';
							
								html+='<div class="aui-user-img" style="margin-left: .5rem;">';
									html+='<img src="'+static_url+data[i].image+'" alt="">';
								html+='</div>';
								html+='<a href="teacherDetail.html?tid='+data[i].id+'" class="aui-width-one">';
									html+='<div class="aui-flex-box aui-text-gray aui-text-left aui-arrow">';
										html+='<h2 class="aui-text-gray aui-font-size-14 aui-margin-b-5">'+data[i].name+'</h2>';
										html+='<p class="aui-text-gray aui-font-size-12">'+data[i].age+'年教龄</p>';
									html+='</div>';
								html+='</a>	';					
						html+='</div>';
					}
					$('#teacher').html(html);
				}
			}
			
		});
	}
	function getTeacherId(tid){
		window.localStorage.setItem('teacher_id',tid);
		window.location.href="checkTips.html";
	}
    </script>

</body>

</html>
